package com.learn.ch02.pojo;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/02/15
 * @description 复杂数据结构的绑定
 */
@ConfigurationProperties(prefix = "app.data")
public class App {
    private String[] names;
    private List<Address> addressList;
    private Map<String, Address> addressMap;

    @Override
    public String toString() {
        return "App{" +
                "names=" + Arrays.toString(names) +
                ", addressList=" + addressList +
                ", addressMap=" + addressMap +
                '}';
    }

    public void setNames(String[] names) {
        this.names = names;
    }

    public void setAddressList(List<Address> addressList) {
        this.addressList = addressList;
    }

    public void setAddressMap(Map<String, Address> addressMap) {
        this.addressMap = addressMap;
    }
}
